package com.climber.android.commonsdk.util.date;

/**
 * Created by Tony on 3/28/15.
 */
public class BaseDate extends java.util.Date {

    public BaseDate() {
        super(System.currentTimeMillis());
    }

    public BaseDate(long milliseconds) {
        super(milliseconds);
    }

    public BaseDate(java.util.Date date) {
        super(date.getTime());
    }

    /**
     * yyyy-MM-dd
     *
     * @return
     */
    public String toDate() {
        return Date.FORMATTER_DATE.format(this);
    }

    /**
     * yyyy-MM-dd'T'HH:mm:ss'Z'
     * @return
     */
    public String toDateUTC() {
        return Date.FORMATTER_UTC.format(this);
    }

    /**
     * yyyy-MM-dd HH:mm:ss
     *
     * @return
     */
    public String toDateTime() {
        return Date.FORMATTER_DATE_TIME.format(this);
    }

    /**
     * yyyy年MM月dd日
     *
     * @return
     */
    public String toDateCN() {
        return Date.FORMATTER_DATE_CN.format(this);
    }

    /**
     * MM月dd日
     */
    public String toMonthDayCN(){
        return Date.FORMATTER_MONTH_DAY_CN.format(this);
    }

    /**
     * MM-dd
     */
    public String toMonthDay(){
        return Date.FORMATTER_MONTH_DAY.format(this);
    }

    /**
     * yyyy年MM月dd日 HH:mm:ss
     */
    public String toDateTimeCN() {
        return Date.FORMATTER_DATE_TIME_CN.format(this);
    }

    /**
     * HH:mm
     */
    public String toHourMinute(){
        return Date.FORMATTER_HOUR_MINUTE.format(this);
    }

    /**
     * MM月dd日 HH:mm
     * @return
     */
    public String toDayHourCN(){
        return Date.FORMATTER_DAY_HOUR_CN.format(this);
    }

    /**
     * MM-dd HH:mm
     * @return
     */
    public String toDayHour(){
        return Date.FORMATTER_DAY_HOUR.format(this);
    }

    public String toWeek(){
        return Date.FORMAT_WEEK.format(this);
    }
}
